# -*- coding: utf-8 -*-
"""
Created on Sat Oct  9 16:47:48 2021

@author: think
"""

s = input()
if len(s) == 16:
    print('{:0>64b}'.format(int(s, 16)))
elif len(s) == 64:
    print('{:0>16x}'.format(int(s, 2)))
else:
    print('ERROR')